#include "frienditem.h"
#include "ui_frienditem.h"

FriendItem::FriendItem(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FriendItem)
{
    ui->setupUi(this);
}

FriendItem::~FriendItem()
{
    delete ui;
}

QString FriendItem::username() const
{
    return m_username;
}

void FriendItem::setUsername(const QString &newUsername)
{
    ui->label_username->setText(newUsername);
    m_username = newUsername;
}

QString FriendItem::userId() const
{
    return m_userId;
}

void FriendItem::setUserId(const QString &newUserId)
{
    m_userId = newUserId;
}

void FriendItem::mousePressEvent(QMouseEvent *event)
{
    emit signal_addChat(m_userId, Message::SINGAL_CHAT, m_username);
}
